package com.design.facde.player;

// 外观类
class MediaPlayerFacade {
    private AudioDecoder audioDecoder;
    private VideoDecoder videoDecoder;

    public MediaPlayerFacade() {
        audioDecoder = new Mp3Decoder();
        videoDecoder = new Mp4Decoder();
    }

    // 简化播放音频文件的接口
    public void playAudio(String fileName) {
        System.out.println("Playing audio file: " + fileName);
        audioDecoder.decode(fileName);
    }

    // 简化播放视频文件的接口
    public void playVideo(String fileName) {
        System.out.println("Playing video file: " + fileName);
        videoDecoder.decode(fileName);
    }
}
